<!-- HTML header for doxygen 1.8.9.1-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.6"/>
<title>ROSS: core/gvt/mpi_allreduce.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td style="padding-left: 0.5em;">
   <a href="https://github.com/ROSS-org/ROSS">
   <div id="projectname">ROSS
   </div>
   </a>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.6 -->
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
      <li><a href="annotated.html"><span>Data&#160;Structures</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>File&#160;List</span></a></li>
      <li><a href="globals.html"><span>Globals</span></a></li>
    </ul>
  </div>
<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="dir_af18cf245e3394ab3b436135935cfd6e.html">core</a></li><li class="navelem"><a class="el" href="dir_d702b973d4d20fda29a004d0c4a89b11.html">gvt</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="headertitle">
<div class="title">mpi_allreduce.h</div>  </div>
</div><!--header-->
<div class="contents">
<a href="mpi__allreduce_8h.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160;<span class="preprocessor">#ifndef INC_gvt_mpi_allreduce_h</span></div>
<div class="line"><a name="l00002"></a><span class="lineno">    2</span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define INC_gvt_mpi_allreduce_h</span></div>
<div class="line"><a name="l00003"></a><span class="lineno">    3</span>&#160;<span class="preprocessor"></span></div>
<div class="line"><a name="l00004"></a><span class="lineno"><a class="line" href="mpi__allreduce_8h.html#a5ebe8750975e33872b854744a83a3f2d">    4</a></span>&#160;<span class="keyword">static</span> <span class="keywordtype">double</span> <a class="code" href="mpi__allreduce_8h.html#a5ebe8750975e33872b854744a83a3f2d">gvt_print_interval</a> = 0.01;</div>
<div class="line"><a name="l00005"></a><span class="lineno"><a class="line" href="mpi__allreduce_8h.html#a10504ff786bda8b4bc15aa8ef06f6881">    5</a></span>&#160;<span class="keyword">static</span> <span class="keywordtype">double</span> <a class="code" href="mpi__allreduce_8h.html#a10504ff786bda8b4bc15aa8ef06f6881">percent_complete</a> = 0.0;</div>
<div class="line"><a name="l00006"></a><span class="lineno">    6</span>&#160;</div>
<div class="line"><a name="l00007"></a><span class="lineno">    7</span>&#160;<span class="keyword">static</span> <span class="keyword">inline</span> <span class="keywordtype">int</span></div>
<div class="line"><a name="l00008"></a><span class="lineno"><a class="line" href="mpi__allreduce_8h.html#a7a58c92b0e80a7be5f3a741f75df71f8">    8</a></span>&#160;<a class="code" href="mpi__allreduce_8h.html#a7a58c92b0e80a7be5f3a741f75df71f8">tw_gvt_inprogress</a>(<a class="code" href="structtw__pe.html">tw_pe</a> * <a class="code" href="avl__tree_8c.html#ac4c639748d4d5a271d6c54a18f614605">pe</a>)</div>
<div class="line"><a name="l00009"></a><span class="lineno">    9</span>&#160;{</div>
<div class="line"><a name="l00010"></a><span class="lineno">   10</span>&#160;        <span class="keywordflow">return</span> pe-&gt;<a class="code" href="structtw__pe.html#aa98f15c0be3577c62140c24fda6ac062">gvt_status</a>;</div>
<div class="line"><a name="l00011"></a><span class="lineno">   11</span>&#160;}</div>
<div class="line"><a name="l00012"></a><span class="lineno">   12</span>&#160;</div>
<div class="line"><a name="l00013"></a><span class="lineno">   13</span>&#160;<span class="keyword">static</span> <span class="keyword">inline</span> <span class="keywordtype">void</span></div>
<div class="line"><a name="l00014"></a><span class="lineno"><a class="line" href="mpi__allreduce_8h.html#a987cf58596f8cd786d561f50cf23d3d3">   14</a></span>&#160;<a class="code" href="mpi__allreduce_8h.html#a987cf58596f8cd786d561f50cf23d3d3">gvt_print</a>(<a class="code" href="ross_8h.html#a80b370bc538e17441aef6afaff852678">tw_stime</a> gvt)</div>
<div class="line"><a name="l00015"></a><span class="lineno">   15</span>&#160;{</div>
<div class="line"><a name="l00016"></a><span class="lineno">   16</span>&#160;        <span class="keywordflow">if</span>(<a class="code" href="mpi__allreduce_8h.html#a5ebe8750975e33872b854744a83a3f2d">gvt_print_interval</a> == 1.0)</div>
<div class="line"><a name="l00017"></a><span class="lineno">   17</span>&#160;                <span class="keywordflow">return</span>;</div>
<div class="line"><a name="l00018"></a><span class="lineno">   18</span>&#160;</div>
<div class="line"><a name="l00019"></a><span class="lineno">   19</span>&#160;        <span class="keywordflow">if</span>(<a class="code" href="mpi__allreduce_8h.html#a10504ff786bda8b4bc15aa8ef06f6881">percent_complete</a> == 0.0)</div>
<div class="line"><a name="l00020"></a><span class="lineno">   20</span>&#160;        {</div>
<div class="line"><a name="l00021"></a><span class="lineno">   21</span>&#160;                <a class="code" href="mpi__allreduce_8h.html#a10504ff786bda8b4bc15aa8ef06f6881">percent_complete</a> = <a class="code" href="mpi__allreduce_8h.html#a5ebe8750975e33872b854744a83a3f2d">gvt_print_interval</a>;</div>
<div class="line"><a name="l00022"></a><span class="lineno">   22</span>&#160;                <span class="keywordflow">return</span>;</div>
<div class="line"><a name="l00023"></a><span class="lineno">   23</span>&#160;        }</div>
<div class="line"><a name="l00024"></a><span class="lineno">   24</span>&#160;</div>
<div class="line"><a name="l00025"></a><span class="lineno">   25</span>&#160;    <span class="keywordtype">double</span> ts = <a class="code" href="ross_8h.html#a096f73feb08316896d644277b486c9ea">TW_STIME_DBL</a>(gvt);</div>
<div class="line"><a name="l00026"></a><span class="lineno">   26</span>&#160;</div>
<div class="line"><a name="l00027"></a><span class="lineno">   27</span>&#160;    printf(<span class="stringliteral">&quot;GVT #%d: simulation %d%% complete, max event queue size %u (&quot;</span>,</div>
<div class="line"><a name="l00028"></a><span class="lineno">   28</span>&#160;               <a class="code" href="ross-extern_8h.html#aad7609a89939a59a33ae1cd1f5601e7e">g_tw_gvt_done</a>,</div>
<div class="line"><a name="l00029"></a><span class="lineno">   29</span>&#160;               (<span class="keywordtype">int</span>) <a class="code" href="ross-kernel-inline_8h.html#a76b22a7896601c622802f236cae6684a">ROSS_MIN</a>(100, floor(100 * (ts/<a class="code" href="ross-extern_8h.html#aedd6d883bb5b01f0d5c1121f48b0477e">g_tw_ts_end</a>))),</div>
<div class="line"><a name="l00030"></a><span class="lineno">   30</span>&#160;               <a class="code" href="splay_8c.html#a1f13e8f630ca68c8cbbd1bfec7f5870c">tw_pq_max_size</a>(<a class="code" href="ross-extern_8h.html#a2f67789cc425e7d839fa4b983f5b8505">g_tw_pe</a>-&gt;<a class="code" href="structtw__pe.html#a90e1dbe51a084d6e02580667159e13ff">pq</a>));</div>
<div class="line"><a name="l00031"></a><span class="lineno">   31</span>&#160;</div>
<div class="line"><a name="l00032"></a><span class="lineno">   32</span>&#160;    <span class="keywordflow">if</span> (ts == DBL_MAX)</div>
<div class="line"><a name="l00033"></a><span class="lineno">   33</span>&#160;        printf(<span class="stringliteral">&quot;GVT = %s&quot;</span>, <span class="stringliteral">&quot;MAX&quot;</span>);</div>
<div class="line"><a name="l00034"></a><span class="lineno">   34</span>&#160;    <span class="keywordflow">else</span></div>
<div class="line"><a name="l00035"></a><span class="lineno">   35</span>&#160;        printf(<span class="stringliteral">&quot;GVT = %.4f&quot;</span>, ts);</div>
<div class="line"><a name="l00036"></a><span class="lineno">   36</span>&#160;</div>
<div class="line"><a name="l00037"></a><span class="lineno">   37</span>&#160;    printf(<span class="stringliteral">&quot;).\n&quot;</span>);</div>
<div class="line"><a name="l00038"></a><span class="lineno">   38</span>&#160;</div>
<div class="line"><a name="l00039"></a><span class="lineno">   39</span>&#160;<span class="preprocessor">#ifdef AVL_TREE</span></div>
<div class="line"><a name="l00040"></a><span class="lineno">   40</span>&#160;<span class="preprocessor"></span>    printf(<span class="stringliteral">&quot;AVL tree size: %d\n&quot;</span>, <a class="code" href="ross-extern_8h.html#a2f67789cc425e7d839fa4b983f5b8505">g_tw_pe</a>-&gt;<a class="code" href="structtw__pe.html#a2309955aec3bf38ddf4c532e34dd4501">avl_tree_size</a>);</div>
<div class="line"><a name="l00041"></a><span class="lineno">   41</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00042"></a><span class="lineno">   42</span>&#160;<span class="preprocessor"></span></div>
<div class="line"><a name="l00043"></a><span class="lineno">   43</span>&#160;        <a class="code" href="mpi__allreduce_8h.html#a10504ff786bda8b4bc15aa8ef06f6881">percent_complete</a> += <a class="code" href="mpi__allreduce_8h.html#a5ebe8750975e33872b854744a83a3f2d">gvt_print_interval</a>;</div>
<div class="line"><a name="l00044"></a><span class="lineno">   44</span>&#160;}</div>
<div class="line"><a name="l00045"></a><span class="lineno">   45</span>&#160;</div>
<div class="line"><a name="l00046"></a><span class="lineno">   46</span>&#160;<span class="keyword">extern</span> <a class="code" href="ross-types_8h.html#a68910a3e880a16d5acbac8fc120229a2">tw_stat</a> <a class="code" href="mpi__allreduce_8h.html#ab5b7bed8b49012ab92a14632cba26847">st_get_allreduce_count</a>();</div>
<div class="line"><a name="l00047"></a><span class="lineno">   47</span>&#160;</div>
<div class="line"><a name="l00048"></a><span class="lineno">   48</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="ttc" id="ross-extern_8h_html_aad7609a89939a59a33ae1cd1f5601e7e"><div class="ttname"><a href="ross-extern_8h.html#aad7609a89939a59a33ae1cd1f5601e7e">g_tw_gvt_done</a></div><div class="ttdeci">unsigned int g_tw_gvt_done</div><div class="ttdef"><b>Definition:</b> <a href="ross-global_8c_source.html#l00081">ross-global.c:81</a></div></div>
<div class="ttc" id="structtw__pe_html_aa98f15c0be3577c62140c24fda6ac062"><div class="ttname"><a href="structtw__pe.html#aa98f15c0be3577c62140c24fda6ac062">tw_pe::gvt_status</a></div><div class="ttdeci">unsigned char gvt_status</div><div class="ttdoc">Bits available for gvt computation. </div><div class="ttdef"><b>Definition:</b> <a href="ross-types_8h_source.html#l00400">ross-types.h:400</a></div></div>
<div class="ttc" id="ross_8h_html_a80b370bc538e17441aef6afaff852678"><div class="ttname"><a href="ross_8h.html#a80b370bc538e17441aef6afaff852678">tw_stime</a></div><div class="ttdeci">double tw_stime</div><div class="ttdef"><b>Definition:</b> <a href="ross_8h_source.html#l00150">ross.h:150</a></div></div>
<div class="ttc" id="mpi__allreduce_8h_html_ab5b7bed8b49012ab92a14632cba26847"><div class="ttname"><a href="mpi__allreduce_8h.html#ab5b7bed8b49012ab92a14632cba26847">st_get_allreduce_count</a></div><div class="ttdeci">tw_stat st_get_allreduce_count()</div><div class="ttdef"><b>Definition:</b> <a href="mpi__allreduce_8c_source.html#l00020">mpi_allreduce.c:20</a></div></div>
<div class="ttc" id="ross-extern_8h_html_aedd6d883bb5b01f0d5c1121f48b0477e"><div class="ttname"><a href="ross-extern_8h.html#aedd6d883bb5b01f0d5c1121f48b0477e">g_tw_ts_end</a></div><div class="ttdeci">double g_tw_ts_end</div><div class="ttdef"><b>Definition:</b> <a href="ross-global_8c_source.html#l00068">ross-global.c:68</a></div></div>
<div class="ttc" id="structtw__pe_html"><div class="ttname"><a href="structtw__pe.html">tw_pe</a></div><div class="ttdoc">Holds the entire PE state. </div><div class="ttdef"><b>Definition:</b> <a href="ross-types_8h_source.html#l00375">ross-types.h:375</a></div></div>
<div class="ttc" id="ross-kernel-inline_8h_html_a76b22a7896601c622802f236cae6684a"><div class="ttname"><a href="ross-kernel-inline_8h.html#a76b22a7896601c622802f236cae6684a">ROSS_MIN</a></div><div class="ttdeci">#define ROSS_MIN(a, b)</div><div class="ttdef"><b>Definition:</b> <a href="ross-kernel-inline_8h_source.html#l00006">ross-kernel-inline.h:6</a></div></div>
<div class="ttc" id="mpi__allreduce_8h_html_a5ebe8750975e33872b854744a83a3f2d"><div class="ttname"><a href="mpi__allreduce_8h.html#a5ebe8750975e33872b854744a83a3f2d">gvt_print_interval</a></div><div class="ttdeci">static double gvt_print_interval</div><div class="ttdef"><b>Definition:</b> <a href="mpi__allreduce_8h_source.html#l00004">mpi_allreduce.h:4</a></div></div>
<div class="ttc" id="mpi__allreduce_8h_html_a7a58c92b0e80a7be5f3a741f75df71f8"><div class="ttname"><a href="mpi__allreduce_8h.html#a7a58c92b0e80a7be5f3a741f75df71f8">tw_gvt_inprogress</a></div><div class="ttdeci">static int tw_gvt_inprogress(tw_pe *pe)</div><div class="ttdef"><b>Definition:</b> <a href="mpi__allreduce_8h_source.html#l00008">mpi_allreduce.h:8</a></div></div>
<div class="ttc" id="splay_8c_html_a1f13e8f630ca68c8cbbd1bfec7f5870c"><div class="ttname"><a href="splay_8c.html#a1f13e8f630ca68c8cbbd1bfec7f5870c">tw_pq_max_size</a></div><div class="ttdeci">unsigned int tw_pq_max_size(splay_tree *pq)</div><div class="ttdef"><b>Definition:</b> <a href="splay_8c_source.html#l00357">splay.c:357</a></div></div>
<div class="ttc" id="structtw__pe_html_a90e1dbe51a084d6e02580667159e13ff"><div class="ttname"><a href="structtw__pe.html#a90e1dbe51a084d6e02580667159e13ff">tw_pe::pq</a></div><div class="ttdeci">tw_pq * pq</div><div class="ttdoc">Priority queue used to sort events. </div><div class="ttdef"><b>Definition:</b> <a href="ross-types_8h_source.html#l00381">ross-types.h:381</a></div></div>
<div class="ttc" id="structtw__pe_html_a2309955aec3bf38ddf4c532e34dd4501"><div class="ttname"><a href="structtw__pe.html#a2309955aec3bf38ddf4c532e34dd4501">tw_pe::avl_tree_size</a></div><div class="ttdeci">unsigned avl_tree_size</div><div class="ttdef"><b>Definition:</b> <a href="ross-types_8h_source.html#l00393">ross-types.h:393</a></div></div>
<div class="ttc" id="ross-extern_8h_html_a2f67789cc425e7d839fa4b983f5b8505"><div class="ttname"><a href="ross-extern_8h.html#a2f67789cc425e7d839fa4b983f5b8505">g_tw_pe</a></div><div class="ttdeci">tw_pe * g_tw_pe</div><div class="ttdef"><b>Definition:</b> <a href="ross-global_8c_source.html#l00075">ross-global.c:75</a></div></div>
<div class="ttc" id="ross-types_8h_html_a68910a3e880a16d5acbac8fc120229a2"><div class="ttname"><a href="ross-types_8h.html#a68910a3e880a16d5acbac8fc120229a2">tw_stat</a></div><div class="ttdeci">unsigned long long tw_stat</div><div class="ttdef"><b>Definition:</b> <a href="ross-types_8h_source.html#l00048">ross-types.h:48</a></div></div>
<div class="ttc" id="mpi__allreduce_8h_html_a10504ff786bda8b4bc15aa8ef06f6881"><div class="ttname"><a href="mpi__allreduce_8h.html#a10504ff786bda8b4bc15aa8ef06f6881">percent_complete</a></div><div class="ttdeci">static double percent_complete</div><div class="ttdef"><b>Definition:</b> <a href="mpi__allreduce_8h_source.html#l00005">mpi_allreduce.h:5</a></div></div>
<div class="ttc" id="mpi__allreduce_8h_html_a987cf58596f8cd786d561f50cf23d3d3"><div class="ttname"><a href="mpi__allreduce_8h.html#a987cf58596f8cd786d561f50cf23d3d3">gvt_print</a></div><div class="ttdeci">static void gvt_print(tw_stime gvt)</div><div class="ttdef"><b>Definition:</b> <a href="mpi__allreduce_8h_source.html#l00014">mpi_allreduce.h:14</a></div></div>
<div class="ttc" id="avl__tree_8c_html_ac4c639748d4d5a271d6c54a18f614605"><div class="ttname"><a href="avl__tree_8c.html#ac4c639748d4d5a271d6c54a18f614605">pe</a></div><div class="ttdeci">tw_pe * pe</div><div class="ttdef"><b>Definition:</b> <a href="avl__tree_8c_source.html#l00011">avl_tree.c:11</a></div></div>
<div class="ttc" id="ross_8h_html_a096f73feb08316896d644277b486c9ea"><div class="ttname"><a href="ross_8h.html#a096f73feb08316896d644277b486c9ea">TW_STIME_DBL</a></div><div class="ttdeci">#define TW_STIME_DBL(x)</div><div class="ttdef"><b>Definition:</b> <a href="ross_8h_source.html#l00153">ross.h:153</a></div></div>
</div><!-- fragment --></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.6
</small></address>
</body>
</html>
